#!/bin/bash

DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE:-geonode.local_settings}

if [ -n "$VIRTUAL_ENV" ]; then
    DJANGO_ADMIN_CMD=$VIRTUAL_ENV/bin/django-admin
elif hash django-admin 2>/dev/null; then
    DJANGO_ADMIN_CMD=django-admin
else
    DJANGO_ADMIN_CMD=django-admin.py
fi

DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE $DJANGO_ADMIN_CMD "$@"
